package com.example.service;

import com.example.entity.ChinaArea;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * @Title: spring-boot-druid
 * @Package com.example.service
 * @Date 2018/5/9下午1:53
 * @Author PX ye
 * @E-mail yepx2013@gmail.com
 * @Company http://www.yiautos.com
 * @Description: 城市联级
 */
public interface ChinaAreaService {

    /**
     * 获取所有省份
     * @return
     */
    @Cacheable("chinaAreas")
    List<ChinaArea> getChinaAreaAll();

    /**
     * 通过id 获取 城市对象
     * @param id
     * @return
     */
    @Cacheable(value = "chinaArea", key = "'chinaAreas' + #id")
    ChinaArea getChinaAreaById(Long id);
}
